-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
41 lines (31 loc) · 999 Bytes
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int I, G, grenal, VI = 0, VG = 0, emp = 0, i = 0;
do {
I = sc.nextInt();
G = sc.nextInt();
System.out.println("Novo grenal (1-sim 2-nao)");
grenal = sc.nextInt();
if (I > G)
VI++;
else if (G > I)
VG++;
else
emp++;
i++;
} while (grenal == 1);
System.out.println(i + " grenais");
System.out.println("Inter:" + VI);
System.out.println("Gremio:" + VG);
System.out.println("Empates:" + emp);
if (VI > VG)
System.out.println("Inter venceu mais");
else if (VG > VI)
System.out.println("Gremio venceu mais");
else
System.out.println("Nao houve vencedor");
sc.close();
}
}